<@_content id=id>
	<#assign a=object/>
	<#assign id=a.id/>
	<#assign parentId=a.parentId!/>
	<#assign categoryId=a.categoryId!/>
	<#assign modelId=a.modelId!/>
	<#assign attribute=getContentAttribute(a.id)!/>
</@_content>
<@_category id=categoryId!><#assign category=object/></@_category>
<@_model id=modelId!><#assign model=object/></@_model>
<script>
function clickAddTag(){
	$('.tags .button').click();
}
</script>
<form method="post" action="cmsContent/save.do?callbackType=closeCurrent&navTabId=cmsContent/list" class="pageForm required-validate" onsubmit="clickAddTag(); return validateCallback(this,navTabAjaxDone);">
	<input name="id" type="hidden" value="${id!}" />
	<input name="parentId" type="hidden" value="${parentId!}" />
	<div class="formBar">
		<ul>
			<li>
				<label><input type="checkbox" name="draft" />保存为草稿</label>
			</li>
			<li><button type="submit" class="buttonActive">保存</button></li>
			<li><button type="button" class="button close">取消</button></li>
		</ul>
	</div>
	<div class="tabs">
		<div class="tabsHeader">
	        <div class="tabsHeaderContent">
	            <ul>
					<li><a href="javascript:;">基础信息</a></li>
				<#if !model?has_content||!model.onlyUrl>
					<li><a href="javascript:;">正文信息</a></li>
				</#if>
					<li><a href="javascript:;">推荐信息</a></li>
	            </ul>
	        </div>
	    </div>
	    <div class="tabsContent unitBox">
			<div class="pageFormContent" layoutH="86">
				<@_content id=parentId>
					<dl class="nowrap">
						<dt>父内容:</dt>
						<dd>
							${(object.title)!}
						</dd>
					</dl>
				</@_content>
					<dl>
						<dt>分类:</dt>
						<dd>
							<input name="categoryId" type="hidden" value="${categoryId!}"/>
							${(category.name)!}
						</dd>
					</dl>
					<dl>
						<dt>模型:</dt>
						<dd>
							<input name="modelId" type="hidden" value="${modelId!}"/>
							${(model.name)!}
						</dd>
					</dl>
					<dl class="nowrap">
						<dt>标题:</dt>
						<dd>
							<input class="required" name="title" type="text" maxlength="255" size="60" value="${(a.title?html)!}"/>
							<#if !model?has_content||!model.onlyUrl><label><input name="copied" type="checkbox" onclick="if($(this).is(':checked')){$('.copied').show();}else{$('.copied').hide();$('.copied input[type=text]',navTab.getCurrentPanel()).val('');}"/>转载</label></#if>
						</dd>
					</dl>
					<dl class="copied" style="display:none">
						<dt>来源:</dt>
						<dd><input name="source" type="text" maxlength="50" size="20" value="${(attribute.source)!}"/></dd>
					</dl>
					<dl class="copied" style="display:none">
						<dt>来源网址:</dt>
						<dd><input class="url" name="sourceUrl" type="text" maxlength="255" size="20" value="${(attribute.sourceUrl)!}"/></dd>
					</dl>
				<#if a?has_content&&a.copied>
					<script>
						$('input[name=copied]',navTab.getCurrentPanel()).click();
					</script>
				</#if>
				<#if model?has_content&&model.onlyUrl>
					<dl class="nowrap">
						<dt>网址:</dt>
						<dd>
							<input name="onlyUrl" type="hidden" value="true" />
							<input name="url" type="text" maxlength="1000" style="width: 100%;" value="${(a.url)!}"/>
						</dd>
					</dl>
				<#else>
					<dl>
						<dt>作者:</dt>
						<dd><input name="author" type="text" maxlength="50" size="20" value="${(a.author)!}"/></dd>
					</dl>
					<dl>
						<dt>编辑:</dt>
						<dd><input name="editor" type="text" maxlength="50" size="20" value="${(a.editor)!}"/></dd>
					</dl>
					<#include "../include_page/tags.html"/>
					<#assign tagTypeIds=category.tagTypeIds!''/>
					<#assign tagIds=(a.tagIds)!''/>
					<@tags tagTypeIds tagIds/>
				</#if>
					<dl class="nowrap">
						<dt>描述:</dt>
						<dd><textarea name="description" maxlength="300" style="width: 100%;" rows="5">${(a.description?html)!}</textarea></dd>
					</dl>
					<dl>
						<dt>定时发布:</dt>
						<dd>
							<input name="timing" type="checkbox" onclick="if($(this).is(':checked')){$('#publishDate',navTab.getCurrentPanel()).show();$('input[name=publishDate]',navTab.getCurrentPanel()).addClass('required').addClass('valid')}else{$('#publishDate',navTab.getCurrentPanel()).hide();$('input[name=publishDate]',navTab.getCurrentPanel()).removeClass('required').removeClass('valid')}"/>
						</dd>
					</dl>
					<dl id="publishDate" style="display:none">
						<dt>发布日期:</dt>
						<dd>
							<input class="date" name="publishDate" type="text" size="20" dateFmt="yyyy-MM-dd HH:mm:ss" value="${(a.publishDate)!}"/>
							<a class="inputDateButton" href="javascript:;">选择</a>
						</dd>
					</dl>
				<#if a?has_content&&a.publishDate gt .now>
					<script>
						$('input[name=timing]',navTab.getCurrentPanel()).click();
					</script>
				</#if>
					<dl class="nowrap">
						<dt>封面:</dt>
						<dd>
							<input name="cover" value="${(a.cover)!}" maxlength="300" size="40" type="text"/>
							<a class="btnAttach" href="common/upload.html?field=cover&onlyImage=true" lookupGroup="" width="560" height="300">图片</a>
							<#include "../include_page/preview.html"/>
							<@preview 'content' 'input[name=cover]'/>
						</dd>
					</dl>
		<#include "../include_page/extendData.html"/>
		<#if category?has_content&&category.extendId?has_content>
			<@_sysExtendFieldList extendId=category.extendId>
				<#assign extendList=page.list![]/>
				<#assign extendValue=attribute!{}/>
				<@extendData 'categoryExtendDataList' extendList extendValue/>
			</@_sysExtendFieldList>
		</#if>
		<#if model?has_content&&model.extendId?has_content>
			<@_sysExtendFieldList extendId=model.extendId>
				<#assign extendList=page.list![]/>
				<#assign extendValue=attribute!{}/>
				<@extendData 'modelExtendDataList' extendList extendValue/>
			</@_sysExtendFieldList>
		</#if>
		<#if model?has_content&&(model.hasImages||model.hasFiles)>
			<#include "../include_page/contentFiles.html"/>
			<#if model.hasImages>
				<@contentFiles true id!/>
			</#if>
			<#if model.hasFiles>
				<@contentFiles false id!/>
			</#if>
		</#if>
				</div>
		<#if !model?has_content||!model.onlyUrl>
			<div class="pageFormContent" layoutH="86">
				<dl class="nowrap">
					<dt>正文:</dt>
					<dd style="width:800px">
						<textarea name="text" class="required editor" style="width: 100%;" rows="20">${(attribute.text?html)!}</textarea>
					</dd>
				</dl>
			</div>
		</#if>
			<div class="pageFormContent" layoutH="86">
				<#include "../include_page/related.html"/>
				<@related id!/>
			</div>
		</div>
	</div>
</form>